package com.jsftoolkit.gen.info;

import javax.faces.component.EditableValueHolder;

import com.jsftoolkit.utils.Utils;

/**
 * Describes the name of the request parameter to decode on post-back. e.g.
 * specifying decode="${id}:foo" (suppose id="bar") evaluates the request
 * parameter "bar:foo" and calls
 * {@link EditableValueHolder#setSubmittedValue(Object)} with the returned
 * value.
 * 
 * @author noah
 * 
 */
public class DecodeInfo {
	private String[] props;

	private String[] defaults;

	private String format;

	public DecodeInfo(String[] props, String[] defaults, String format) {
		super();
		Utils.notNull(props, "props");
		Utils.notNull(defaults, "defaults");
		Utils.notNull(format, "format");
		this.props = props;
		this.defaults = defaults;
		this.format = format;
	}

	public String[] getDefaults() {
		return defaults;
	}

	public String getFormat() {
		return format;
	}

	public String[] getProps() {
		return props;
	}

	@Override
	public String toString() {
		return super.toString();
	}
}
